package com.hdaccp.shuiguoD.controller;

import com.hdaccp.shuiguoD.entity.Xiaoshouxx;
import com.hdaccp.shuiguoD.service.XiaoshouxxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/xiaoshouxx")
@Scope("prototype")
public class XiaoshouxxController {
    @Autowired
    private XiaoshouxxService xiaoshouxxService;

    @RequestMapping("/cx")
    @ResponseBody
    public List<Xiaoshouxx> cx(int dh){
        return xiaoshouxxService.getAll(dh);
    }

    @RequestMapping("/addxx")
    @ResponseBody
    public int addxx(Xiaoshouxx xiaoshouxx){
        return xiaoshouxxService.addxx(xiaoshouxx);
    }

}
